<template>
  <div class="foryou">
    <div class="title">
      <div class="line"></div>
      <div class="name">
        <van-icon name="stop" />
        <span>为你推荐</span>
        <van-icon name="stop" />
      </div>
      <div class="line"></div>
    </div>
    <ul class="tuijian">
      <li v-for="l in item" :key="l.id">
        <router-link :to="`/detail/${l.id}`">
          <van-image :src="l.image" />
          <p>{{ l.store_name }}</p>
          <span>￥{{ l.price }}</span>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "ForYou",
  props: ["item"]
};
</script>

<style lang="less" scoped>
.tuijian {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  li {
    width: 45vw;
    height: 5rem;
    margin: 0.2rem;
    background: white;
    .van-image {
      width: 4rem;
      height: 4rem;
    }
    p {
      text-align: left;
      padding-left: 0.2rem;
      font-size: 0.4rem;
      color: rgb(51, 51, 51);
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
      overflow: hidden;
    }
    span {
      display: block;
      text-align: center;

      color: red;
      font-size: 0.35rem;
    }
  }
}

.title {
  height: 1.2rem;
  font-size: 0.4rem;
  color: #282828;

  display: flex;
  align-items: center;
  justify-content: center;

  .line {
    width: 2.3rem;
    height: 0.04rem;
    background-color: #e9e9e9;
  }
  .name {
    margin: 0 0.2rem;

    span {
      font-size: 0.38rem;
      vertical-align: middle;
      font-weight: bold;
    }
    i {
      vertical-align: middle;
      transform: rotate(45deg);
    }
  }
}
</style>
